import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/login',
    },
    {
      path: '/login',
      component: () => import('../pages/Login.vue'),
    },
    {
      path: '/home',
      component: () => import('../pages/Home.vue'),
      children: [
        {
          path: '/home/access_control',
          component: () => import('../pages/home/AccessControl.vue'),
        },
        {
          path: '/home/device_management',
          component: () => import('../pages/home/DeviceManagement.vue'),
        },
        {
          path: '/home/monitoring1',
          component: () => import('../pages/home/Monitoring1.vue'),
        },
        {
          path: '/home/monitoring2',
          component: () => import('../pages/home/Monitoring2.vue'),
        },
        {
          path: '/home/permission1',
          component: () => import('../pages/home/Permission1.vue'),
        },
        {
          path: '/home/permission2',
          component: () => import('../pages/home/Permission2.vue'),
        },
        {
          path: '/home/system1',
          component: () => import('../pages/home/System1.vue'),
        },
        {
          path: '/home/system2',
          component: () => import('../pages/home/System2.vue'),
        },
      ],
    },
  ],
})

export default router
